﻿using System;
using System.Collections.Generic;
using Keyki.NefClass.Kernel.Data;
using Keyki.NefClass.Kernel.Fuzzy.Rulles;

namespace Keyki.NefClass.Kernel.Fuzzy.ChooceRule
{
	public class SimpleRule : AbstractRule
	{
		/// <summary>
		/// Creates rulle base with first countRulles
		/// </summary>
		public override void Procedure(List<Antecedent> antecedents, DataSet dataSet, ref List<FuzzyRule> rulles, int countRulles)
		{
			if (countRulles >= antecedents.Count)
				throw new IndexOutOfRangeException("Too much rulles in result rulles base");

			
			CreateAllRules(antecedents,dataSet,out rulles);

			rulles.RemoveRange(countRulles, rulles.Count - countRulles);
		}//Procedure
	}//SimpleRule
}